package com.xcity.util;

public class ArraysUtils {

	public static <T> int indexOf(T obj, T... arrays) {
		if (arrays == null) {
			return -1;
		}
		for (int i = arrays.length - 1; i >= 0; i--) {
			if (obj == arrays[i]) {
				return i;
			}
		}
		return -1;
	}
	
	public static <T> boolean contains(T obj, T... arrays) {
		return indexOf(obj, arrays) >= 0;
	}
	
}
